﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DTN.Core;
using Hanel.DTN.News;


public partial class Control_Home_ListTinNoiBat_right : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Display();
    }
    protected void Display()
    {
        ItblContentManager obj = tblContentManager.CreateInstance();
        DataTable dt = obj.SelecttblContentDynamic_top("Top 6", "Status=1", "ID_Content desc");
        try
        {
            int id = int.Parse(dt.Rows[5]["ID"].ToString());
            DataTable dt2 = obj.SelecttblContentDynamic_top("Top 8", "Status=1 and id<" + id, "ID_Content desc");

            Repeater1.DataSource = dt2;
            Repeater1.DataBind();
        }
        catch(Exception e) { }

        DataTable dthot = obj.SelecttblContentDynamic_top("Top 8", "Status=1 and CONVERT(VARCHAR(8),(GETDATE()-Ngay),112)<19000130", "Visited desc"); //CONVERT(VARCHAR(8),(GETDATE()-Ngay),112)<19000130 : tinh so ngay tu luc dang tin cho toi hien tai, neu trong vong 1 thang thi moi hien thi, ngoai 1 thang thi ko
        Repeater2.DataSource = dthot;
        Repeater2.DataBind();
    }
}